package test0109;
public class Test01 {
    public static void main(String[] args) {
        // (1)统计字符串中某个数字出现的次数
        String s = "1827314132131453645234323";
        int i = m(s, 3);
        System.out.println(i);
    }
    public static int m(String s, int num) {
        int count = 0;
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            int d = Integer.parseInt(String.valueOf(c));
            if (d == num) {
                count++;
            }
        }
        return count;
    }
}